package com.bite.lesson2;

public class Demo_05 {
    public static void main(String[] args) {
        Thread tc = new Thread(() -> {
            System.out.println(Thread.currentThread().getName());
        },"c");

        Thread tb = new Thread(() -> {
            try {
                tc.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());
        },"b");

        Thread ta = new Thread(() -> {
            try {
                tb.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName());
        },"a");

        ta.start();
        tb.start();
        tc.start();

    }
}
